package com.example.index;

import lombok.Data;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;


@Document(
        indexName = "book"
)
@Data
@ToString
public class Book implements Serializable {

    @Id
    private Long id;

    @Field(analyzer = "ik_max_word", type = FieldType.Text)
    private String bookName;

    @Field(type = FieldType.Keyword)
    private String author;

    private float price;

    private int page;


    @Field(type = FieldType.Keyword)
    private String category;

}
